from event import Event


if __name__ == "__main__":
    # config_data = None
    # config_file = "config.json"
    # with open(config_file, 'r', encoding='utf-8') as f:
    #     try:
    #         config_data = json.load(f)
    #         print(config_data)
    #     except Exception as e:
    #         print("Error: Could not load config file", e)
    # # 格式检查
    # flag = check_format(config_data)
    # if flag:
    #     event = Event(config_data)
    #     event.init()
    #     # app.run(host='10.100.72.88', port=5001)
    #     # threading.Thread(target=lambda: app.run(host='10.129.0.23', port=5001, use_reloader=False)).start()
    #     event.add_message()
    try:
        event = Event()
        event.init()
        # app.run(host='10.100.72.88', port=5001)
        # threading.Thread(target=lambda: app.run(host='10.129.0.23', port=5001, use_reloader=False)).start()
        event.add_message()
    except Exception as e:
        print("Error", e)
